<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Ajax提交form表单</title>
  </head>
  <body>
    <form
      action=""
      id="login"
      method="POST"
      enctype="application/x-www-form-urlencoded"
    >
      <input type="text" name="username" placeholder="用户名" />
      <input type="password" name="password" placeholder="密码" />
      <input id="submit" type="submit" value="登录" />
    </form>
    <script>
      // 1、使用ajax提交表单
    </script>
  </body>
</html>
